ACCOUNTS = 'SHOTGUN:ACCOUNTS'
SHARES = 'SHOTGUN:SHARES'
SECURITY_INFO = 'SECURITY_STATICS'

REVERSE_REPO_LIMIT = 100000


class TradeAPIType:
    TDX = 'tdx'


class OrderStatus:
    CREATED = 1
    CANCELED = 2
    DEALT = 3
    FAILED = 4
    UNKNOWN = 9


class TradeCode:
    BUY = 'B'
    SELL = 'S'
    QUERY = 'Q'
    CANCEL = 'C'
    NEW_STOCK = 'N'  # 新股申购
    REVERSE_REPO = 'V'  # 逆回购


class SendOrderCategory:
    BUY = 0  # 买入
    SELL = 1  # 卖出
    LEVERAGE_BUY = 2  # 融资买入
    RENT_COUPONS_TO_SELL = 3  # 融券卖出
    BUY_COUPONS_TO_RETURN_COUPONS = 4  # 买券还券
    SELL_COUPONS_TO_RETURN_MONEY = 5  # 现券还券


class SendOrderPriceType:
    LIMIT_CHARGE = 0  # 沪深限价委托
    SZ_OTHER_OPTIMAL = 1  # 深圳对方最优价格
    SZ_SELF_OPTIMAL = 2  # 深圳本方最优价格
    SZ_MARKET_ORDER = 3  # 深圳即时成交剩余撤销
    FIVE_LEVEL_MARKET_ORDER = 4  # (市价委托)上海五档即时成交剩余撤销，深圳五档即时成交剩余撤销
    SZ_DEAL_ALL_OR_CANCEL = 5  # 深圳全额成交或者撤销
    SH_REAL_DEAL_TO_LIMIT = 6  # SH_REAL_DEAL_TO_LIMIT


class QueryDataCategory:
    BALANCE = 0  # 资金
    SHARES = 1  # 股份
    TODAY_ENTRUSTMENT = 2  # 当日委托
    TODAY_TRANSACTION = 3  # 当日成交
    CAN_CANCEL = 4  # 可撤单
    NEW_STOCK = 5  # 新股
    MARGIN_DEBT = 6  # 融资余额
    MARGIN_BALANCE = 7  # 融券余额
    FINANCING_STOCKS = 8  # 可融证券


class QueryHistoryDataCategory:
    HISTORY_ENTRUST = 0  # 历史委托
    HISTORY_TRANSACTION = 1  # 历史成交
    DELIVERY_ORDER = 2  # 交割单
